package YZ.Students.Mier.Tool.utils;

import com.alibaba.druid.pool.DruidDataSource;
import com.alibaba.druid.pool.DruidDataSourceFactory;
import java.util.Properties;

/**
 * @className: druidTool
 * @author: shuishui
 * @date: 2022/12/02 19:23
 */
public class druidTool {
    public static DruidDataSource dataSource=null;

    /**
     * 配置文件对象
     */
    public static Properties p=new Properties();

    static {
        try {
            //加载配置文件对象
            p.load(druidTool.class.getClassLoader().getResourceAsStream("jdbc.properties"));
            //获得连接池
            dataSource= (DruidDataSource) DruidDataSourceFactory.createDataSource(p);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

}
